home *** CD-ROM | disk | FTP | other *** search
-
-
-
- qqqqggggeeeettttffffdddd((((3333GGGG)))) qqqqggggeeeettttffffdddd((((3333GGGG))))
-
-
-
- NNNNAAAAMMMMEEEE
- qqqqggggeeeettttffffdddd - get the read file descriptor associated with the event queue
-
- FFFFOOOORRRRTTTTRRRRAAAANNNN 77777777 SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
- iiiinnnntttteeeeggggeeeerrrr****4444 ffffuuuunnnnccccttttiiiioooonnnn qqqqggggeeeettttffffdddd
-
- PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
- _n_o_n_e
-
- FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
- The returned function value is the read file descriptor associated with
- the event queue. If there is an error, the returned value is a negative
- integer whose absolute value is an error value defined in <_e_r_r_n_o._h>.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- qqqqggggeeeettttffffdddd returns the read file descriptor associated with the event queue.
- The file descriptor can then be used with the _s_e_l_e_c_t(2) system call.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEE
- The following example (presented in pseudo-code; not to be typed
- verbatim) is suggested for reading events off of the GL queue using
- _s_e_l_e_c_t(2):
-
- FD_ZERO(&readfds);
- if ((glfd = qgetfd()) < 0) {
- printf("bad file descriptor %d0, glfd);
- exit(-1);
- }
- for (;;) {
- while (qtest()) {
- .
- .
- blkqread()
- .
- .
- }
- /* Make sure all GL rendering which may be acting as a prompt or
- * cue for the user has completed before checking for a response
- * from the user.
- */
- gflush();
- FD_SET(glfd,&readfds); /* select with qgetfd descriptor */
- FD_SET(,); /* select with others descriptors */
- .
- nfound = select (,&readfds,,,);
- if (FD_ISSET(glfd,&readfds)) /* process queue events */
- continue;
- if (FD_ISSET(,)) { /* process other then queue events */
- .
- .
- }
- }
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- qqqqggggeeeettttffffdddd((((3333GGGG)))) qqqqggggeeeettttffffdddd((((3333GGGG))))
-
-
-
- The example provides two important pieces of advice. First, use _b_l_k_q_r_e_a_d
- instead of multiple _q_r_e_a_d_s because it is more efficient. Second, to
- ensure the proper behavior of _s_e_l_e_c_t, call _q_t_e_s_t before and after you
- call _s_e_l_e_c_t. When _s_e_l_e_c_t indicates data is available on the file
- descriptor, there may not be GL event data to read. Similarly, there is
- a condition where _s_e_l_e_c_t would block, but data is available. The use of
- _q_t_e_s_t before and after _s_e_l_e_c_t guards against this.
-
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- qread, gflush, select(2) (in the _P_r_o_g_r_a_m_m_e_r'_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l)
-
- NNNNOOOOTTTTEEEESSSS
- This routine is available only in immediate mode.
-
- BBBBUUUUGGGGSSSS
- The file descriptor returned by qqqqggggeeeettttffffdddd will not be detected as ready for
- reading by the system call _s_e_l_e_c_t(2) when TIMER events are inserted into
- the queue. Instead, one should use the timeout feature of _s_e_l_e_c_t(2) to
- achieve the same functionality.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-